<?php
/**
 * Created by PhpStorm.
 * User: qhzhyt
 * Date: 2018/10/4
 * Time: 17:06
 */
require '../vendor/autoload.php';

use Medoo\Medoo;

require_once 'logger_conf.php';
try{
    $db = new Medoo(
        [
            'database_type' => 'mysql',
            'database_name' => 'thm',
            'server' => 'localhost',
            'username' => 'thm',
            'password' => 'thm123456',
            'charset' => 'utf8',
            'port' => 3306,
            'option' => [PDO::ATTR_CASE => PDO::CASE_NATURAL]
        ]);
}
catch (PDOException $PDOException){
    $log->addDebug('数据库连接失败！');
    $log->addError($PDOException->getMessage());
    exit(1);
}


if ($db){
    # $log->addDebug('数据库连接成功！');
}
//$row=$db->get('user','*');

//$log->addDebug(var_dump($row));